#ifndef NGX_BLOG_H
#define NGX_BLOG_H
extern "C"{
#include <ngx_core.h>
}

typedef struct{
    ngx_int_t wd;
    ngx_str_t dir_or_file;
}wd_dir_key_val_t;

typedef struct
{


    //eg:
    //string src_root_dir = string("/home/iamdsy/nginx-blog/");
    //md files put into /home/iamdsy/nginx-blog/blog/
    ngx_str_t src_root_dir;

    //eg:
    //string dst_root_dir = string("/home/iamdsy/blog-test-html/");
    ngx_str_t dst_root_dir;

    //eg:
    //string html_title = "君子楼";
    //string blog_name = "君子楼";
    //string blog_subname = "勇燕文房";
    //int max_item_per_page = 10;

    ngx_str_t html_title;
    ngx_str_t blog_name;
    ngx_str_t blog_subname;
    ngx_uint_t max_item_per_page;

    //these two variables are not used to
    //in nging.conf
    //using to store inotify_fd and
    //watched return and directory
    ngx_int_t inotify_fd;
    ngx_int_t wd[2];
    ngx_array_t* wd_dir_key_val;
}ngx_http_blog_main_conf_t;

struct inotify_dir_event{
    int inotify_fd;
    //stored md dir or md's subdir
    char self_passwd[16];
};


#endif // NGX_BLOG_H
